<html>
<head><meta charset="utf-8"><title>Suppressing/Changing ICE Message · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Suppressing.2FChanging.20ICE.20Message.html">Suppressing/Changing ICE Message</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="213252167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Suppressing/Changing%20ICE%20Message/near/213252167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Suppressing.2FChanging.20ICE.20Message.html#213252167">(Oct 14 2020 at 06:57)</a>:</h4>
<p>Hey folks, is anyone who's familiar with the <code>-Z codegen-backend</code> option, know if there's a way to suppress rustc's ICE error message? Right now if you're writing a backend and it panics, the error message tells you it's a bug with rust and to open an issue on the rust repository, which is misleading since the bug is in an external library, and the rust teams can't solve it.</p>



<a name="213256549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Suppressing/Changing%20ICE%20Message/near/213256549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Suppressing.2FChanging.20ICE.20Message.html#213256549">(Oct 14 2020 at 07:57)</a>:</h4>
<p>Rather than suppressing the ICE message, setting a custom issue report location would be nice.</p>



<a name="213256701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Suppressing/Changing%20ICE%20Message/near/213256701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Suppressing.2FChanging.20ICE.20Message.html#213256701">(Oct 14 2020 at 07:59)</a>:</h4>
<p>Also the ICE code seems to parse <code>std::env::args()</code> even when different arguments have been passed to rustc_driver. This is a bit annoying in cg_clif, as jit mode uses a <code>--jit</code> arguments, which rustc will report as unrecognized option when panicking.</p>



<a name="213257382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Suppressing/Changing%20ICE%20Message/near/213257382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Suppressing.2FChanging.20ICE.20Message.html#213257382">(Oct 14 2020 at 08:07)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/131828-t-compiler/topic/Suppressing.20ICE.20Message/near/213256549">said</a>:</p>
<blockquote>
<p>Rather than suppressing the ICE message, setting a custom issue report location would be nice.</p>
</blockquote>
<p>Yeah that would be nice. I was mostly wondering if there was a way without changes to rustc.</p>



<a name="213260275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Suppressing/Changing%20ICE%20Message/near/213260275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Suppressing.2FChanging.20ICE.20Message.html#213260275">(Oct 14 2020 at 08:43)</a>:</h4>
<p>It is possible to override the panic hook from within <code>codegen_crate</code>.</p>



<a name="213268658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Suppressing/Changing%20ICE%20Message/near/213268658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Suppressing.2FChanging.20ICE.20Message.html#213268658">(Oct 14 2020 at 10:14)</a>:</h4>
<p>You should be able to use this: <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/fn.report_ice.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/fn.report_ice.html</a></p>



<a name="213270130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Suppressing/Changing%20ICE%20Message/near/213270130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Suppressing.2FChanging.20ICE.20Message.html#213270130">(Oct 14 2020 at 10:32)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> Yep, works perfectly thanks!</p>



<a name="213394921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Suppressing/Changing%20ICE%20Message/near/213394921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Suppressing.2FChanging.20ICE.20Message.html#213394921">(Oct 15 2020 at 08:41)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> <a href="#narrow/stream/131828-t-compiler/topic/Suppressing.2FChanging.20ICE.20Message/near/213268658">said</a>:</p>
<blockquote>
<p>You should be able to use this: <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/fn.report_ice.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/fn.report_ice.html</a></p>
</blockquote>
<p>That function calls the function stored in <code>DEFAULT_HOOK</code>, which upon initialization sets the panic hook to <code>report_ice</code> with the default bug report url.</p>



<a name="213402747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Suppressing/Changing%20ICE%20Message/near/213402747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Suppressing.2FChanging.20ICE.20Message.html#213402747">(Oct 15 2020 at 10:01)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> Fwiw, I can verify that setting your own panic hook and calling report ice in it with your own URL will output what you expect.</p>



<a name="213402825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Suppressing/Changing%20ICE%20Message/near/213402825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Suppressing.2FChanging.20ICE.20Message.html#213402825">(Oct 15 2020 at 10:02)</a>:</h4>
<p>Yes, it does the first time, but the next time, the panic hook is changed.</p>



<a name="213403046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Suppressing/Changing%20ICE%20Message/near/213403046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Suppressing.2FChanging.20ICE.20Message.html#213403046">(Oct 15 2020 at 10:04)</a>:</h4>
<p>Wouldn't that only be a problem if rustc (or my code) caught the panic?</p>



<a name="213403222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Suppressing/Changing%20ICE%20Message/near/213403222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Suppressing.2FChanging.20ICE.20Message.html#213403222">(Oct 15 2020 at 10:06)</a>:</h4>
<p><a href="https://github.com/bjorn3/rustc_codegen_cranelift/issues/1087">https://github.com/bjorn3/rustc_codegen_cranelift/issues/1087</a> will require a long living process that compiles multiple times.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>